import 'dart:async';

import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';
import 'package:retrofit/error_logger.dart';
import 'package:retrofit/http.dart';

import '../../models/TokenInfo.dart';

part 'RestClient.g.dart';

@RestApi(baseUrl: 'https://fc.hongfund.com:8602/',parser: Parser.FlutterCompute)
abstract class RestClient {
  factory RestClient(Dio dio, {String? baseUrl}) = _RestClient;
  // factory RestClient(Dio dio, {String? baseUrl}) = _RestClient;

  @POST('/api/app/user/login')
  // Future<TokenInfo> login(@Field() Map<String, dynamic> fields);
  Future<TokenInfo> login(@Field('username') String username, @Field('password') String password);
}


TokenInfo deserializeTokenInfo(Map<String, dynamic> json) => TokenInfo.fromJson(json);
Map<String, dynamic> serializeTokenInfo(TokenInfo object) => object.toJson();

